﻿using System.Data.Entity;
using SportsStore.Domain.Entities;

namespace SportsStore.Domain
{
    public class PowerContext : DbContext
    {
        #region Power

        public DbSet<Product> Products { get; set; }



        #endregion
        public PowerContext() : base("name=DefaultConnection")
        {

        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {


            //modelBuilder.Entity<Power>().HasMany(x => x.Roles).WithMany(x => x.Powers).Map(x =>
            //{
            //    x.ToTable("PowerRoles", "Auth");
            //});

            modelBuilder.Entity<Product>().ToTable("Products", "SportsStore");          


            //modelBuilder.Entity<EmployeeEntity>().ToTable("Employee");
            //modelBuilder.Entity<EmployeeEntity>().ToTable("Employee");

            //modelBuilder
            //    .Entity<Plasma>()
            //    .Property(t => t.RegistrationId)
            //    .IsRequired()
            //    .HasColumnAnnotation(
            //        IndexAnnotation.AnnotationName,
            //        new IndexAnnotation(
            //            new IndexAttribute("IX_EmployeeUserName", 1) { IsUnique = true }));

        }
    }
}